from flask import Flask
from settings import Config, db
from index_page import index_page
from list_page import list_page
#from detail_page import detail_page
#from user_page import user_page


app = Flask(__name__, static_folder="static", static_url_path="")
# 添加应用设置
app.config.from_object(Config)
# 利用应用设置初始化数据库
db.init_app(app)
# 将蓝图注册到app中
app.register_blueprint(index_page, url_prefix='/')
app.register_blueprint(list_page, url_prefix='/')
#app.register_blueprint(detail_page, url_prefix='/detail')
#app.register_blueprint(user_page, url_prefix='/user')

if __name__ == '__main__':
    app.run(debug=True)